package com.xhsj.user.hr.process.tbLearningGarden.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhsj.user.hr.process.dto.tbLearningGarden.LearningStatisticsListDto;
import com.xhsj.user.hr.process.dto.tbLearningGarden.MyLearningGardenContentApplyListDto;
import com.xhsj.user.hr.process.dto.tbLearningGarden.RunLearningGardenContentApplyListDto;
import com.xhsj.user.hr.process.hrTransferJob.query.CompletedTransferJobApplyQuery;
import com.xhsj.user.hr.process.hrTransferJob.query.MyTransferJobApplyListQuery;
import com.xhsj.user.hr.process.hrTransferJob.query.RunTransferJobApplyListQuery;
import com.xhsj.user.hr.process.tbLearningGarden.entity.TbLearningGardenContentApply;
import com.xhsj.user.hr.process.tbLearningGarden.query.*;
import com.xhsj.user.hr.process.tbLearningGarden.vo.FindUnReadListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 学习园地-内容 Mapper 接口
 * </p>
 *
 * @author liuqinghua
 * @since 2020-11-20
 */
@Mapper
public interface TbLearningGardenContentApplyMapper extends BaseMapper<TbLearningGardenContentApply> {

    /**
     * 学习园地-内容 删除
     * @author liuqinghua
     * @date Nov 20, 2020 10:59:29 AM
     */
    void deletePush(@Param("id") Integer id);

    /**
     * 我的学习园地内容申请列表
     * @author liuqinghua
     * @date Nov 23, 2020 10:59:29 AM
     */
    IPage<MyLearningGardenContentApplyListQuery> myLearningGardenContentApplyList(Page<MyLearningGardenContentApplyListQuery> page,
                                                                                  @Param("userId") Long userId,
                                                                                  @Param("data") MyLearningGardenContentApplyListDto data);

    /**
     * 待审核学习园地内容申请列表
     * @author liuqinghua
     * @date Nov 23, 2020 10:07:11 AM
     */
    IPage<RunLearningGardenContentApplyListQuery> runLearningGardenContentApplyList(Page<RunLearningGardenContentApplyListQuery> page,
                                                                                    @Param("userId") Long userId,
                                                                                    @Param("roleList") List<Long> roleList,
                                                                                    @Param("data") RunLearningGardenContentApplyListDto data);

    /**
     * 查询未阅读信息列表
     * @author 苏小林
     * @date 2020/11/23 14:54
     * @param: page
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.xhsj.user.hr.process.tbLearningGarden.vo.FindUnReadListVo>
     */
    IPage<FindUnReadListVo> findUnReadListByUserId(Page<TbLearningGardenContentApply> page, @Param("date") LocalDate date,@Param("userId") Long userId);

    /**
     * @Description:待审核学习园地内容详情
     * @Param:dataId
     * @Author: liuqinghua
     * @Date: 2020/11/23
     */
    GetLearningGardenContentApplyDetailQuery getLearningGardenContentApplyDetail(@Param("dataId") Long dataId);

    /**
     * @Description:  已审核的学习园地内容申请列表
     * @Author: liuqinghua
     * @Date: 2020/11/24
     */
    IPage<CompletedLearningGardenContentApplyQuery> completedLearningGardenContentApplyList(Page<CompletedLearningGardenContentApplyQuery> page,
                                                                                            @Param("userId") Long userId,
                                                                                            @Param("data") RunLearningGardenContentApplyListDto data);

    /**
     * 查询所有未读已读数据
     * @author 苏小林
     * @date 2020/11/23 16:33
     * @param: page
     * @param: now
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.xhsj.user.hr.process.tbLearningGarden.vo.FindUnReadListVo>
     */
    IPage<FindUnReadListVo> findAllReadListByUserId(Page<TbLearningGardenContentApply> page, @Param("date") LocalDate now, @Param("userId") Long userId);

    /**
     * 查询已阅读信息列表
     * @author 苏小林
     * @date 2020/11/26 16:23
     * @param: page
     * @param: now
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.xhsj.user.hr.process.tbLearningGarden.vo.FindUnReadListVo>
     */
    IPage<FindUnReadListVo> findByImportantFlag(Page<TbLearningGardenContentApply> page, @Param("date") LocalDate now,@Param("userId") Long userId);
}
